<script type="text/javascript" src="http://www.w3schools.com/jquery/jquery.js"></script>
<script type="text/javascript" src="https://github.com/douglascrockford/JSON-js"></script>
<script type="text/javascript">
    var id= "<?php echo $this->passedArgs[0]?>";
    var timeService = "https://api.instagram.com/v1/media/"+id+"?access_token=7636074.f59def8.a69157b4454e46b3b69aaf932d66b7ba&callback=?";
    var caption;
    $.getJSON(timeService, function(dt) {
        if (dt.data.caption!=null)
            $("#caption").append(dt.data.caption.text+' <br>');
        $("#images").append('<img src="'+dt.data.images.standard_resolution.url+'" alt="Loading"></img>');
        if (dt.data.location!=null)
            $("#information").append('Place: '+dt.data.location.name+' <br>');
        var tag;
        var comment;
        if (dt.data.tags!=null) {
            tag=dt.data.tags
            $.each(tag, function(i,item) {
                $("#tags").append('['+item+ ']');
            });
        }
        if (dt.data.comments.count!=0) {
            comment=dt.data.comments.data;
            $.each(comment, function(i,item) {
                $("#comments").append('<br>From: '+item.from.username+" : "+item.text);
            });
        }
        $("#user").append(dt.data.user.username);
    });
</script>
<div style="height: 700px;width: 700px;float:left;">
<div id ="caption" style="width: 580px; text-align: center;"></div>
<div id="images"></div>
</div>
<div id="information" style="width:300px;float:left">
    Image information:<br>
</div>
<div id="user">User: </div>
<div id="tags">Tags: </div>
<div id="comments">Comments: </div>